package com.ityuan.springcloud.service.impl;

import org.springframework.stereotype.Service;

import com.ityuan.springcloud.client.user.entity.User;
import com.ityuan.springcloud.service.UserFreignService;
import lombok.extern.slf4j.Slf4j;
/**
 * fallback转移处理类
 * @author lizeqiang
 *
 */
@Slf4j
@Service
public class UserHystrixServiceImpl implements UserFreignService {

	public User getUserById(Long id) {
		// id传入-1时，用户服务抛异常，会执行到此处
		log.error("=========>UserFreignService.getUserById fallback");
		User user = new User();
		user.setName("UserFreignService.getUserById fallback");
		return user;
	}

}
